<template>
<div class='page-container'>
  <div>被克隆的数据：{{waitDeepCloneData}}</div>
  <div>克隆之后的数据：{{deepCloneData}}</div>
  <div>Lodash 中文文档：https://www.lodashjs.com/</div>
</div>
</template>

<script>
import _ from "lodash";

export default {
  data() {
    return {
      waitDeepCloneData: [{ a: 1 }, { b: 2 }],
      deepCloneData: null
    };
  },
  mounted() {
    this.getDeepClone();
  },
  methods: {
    // 深拷贝/深度克隆
    getDeepClone() {
      this.deepCloneData = _.cloneDeep(this.waitDeepCloneData);
    }
  }
};
</script>

<style lang='scss' scoped>
</style>
